package com.dstz.sys.service.impl;


import java.util.Collections;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dstz.base.core.util.BeanCopierUtils;
import com.dstz.sys.api.model.IDataDict;
import com.dstz.sys.api.model.dto.DataDictDTO;
import com.dstz.sys.api.service.DataDictService;
import com.dstz.sys.core.manager.DataDictManager;
import com.dstz.sys.core.model.DataDict;

import cn.hutool.core.collection.CollectionUtil;

/**
 * 用户系统资源服务接口
 * @author jeff
 */
@Service
public class DataDictServiceImpl implements DataDictService{
	@Resource
	DataDictManager dataDictManager;
	
	public List<IDataDict> getDictNodeList(String dictKey, Boolean hasRoot){
		List<DataDict> dictNodeList = dataDictManager.getDictNodeList(dictKey, hasRoot);
		if(CollectionUtil.isNotEmpty(dictNodeList)) {
        	return (List)BeanCopierUtils.transformList(dictNodeList, DataDictDTO.class);
        }
		 return Collections.emptyList();
	};

	

}
